home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet internetowy / Przegladarki internetowe / Mozilla Seamonkey 1.0.5 pl / seamonkey-1.0.5.pl-PL.win32.installer.exe / BROWSER.XPI / bin / chrome / toolkit.jar / content / global / fontpackage.js < prev    next >
Encoding:
JavaScript  |  2005-02-20  |  3.0 KB  |  79 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License
  5.  * Version 1.1 (the "License"); you may not use this file except in
  6.  * compliance with the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is mozilla.org code.
  15.  *
  16.  * The Initial Developer of the Original Code is 
  17.  * Netscape Communications Corporation.
  18.  * Portions created by the Initial Developer are Copyright (C) 2003
  19.  * the Initial Developer. All Rights Reserved.
  20.  *
  21.  * Contributor(s):
  22.  *   Frank Yung-Fong Tang <ftang@netscape.com>
  23.  *   Simon Montagu <smontagu@netscape.com>
  24.  *   Seth Spitzer <sspitzer@netscape.com>
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either the GNU General Public License Version 2 or later (the "GPL"), or 
  28.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. var gLangCode;
  41.  
  42. function onLoad()
  43. {
  44.   var fontPackageBundle = document.getElementById("fontPackageBundle");
  45.  
  46.   // argument is a lang code of the form xx or xx-yy
  47.   gLangCode = window.arguments[0];
  48.  
  49.   // test if win2k (win nt 5.0) or winxp (win nt 5.1)
  50.   if (navigator.userAgent.toLowerCase().indexOf("windows nt 5") != -1) 
  51.   {
  52.     document.getElementById("size").hidden = true;
  53.     var dialog = document.documentElement;
  54.     dialog.getButton("accept").hidden = true;
  55.  
  56.     // if no download button
  57.     // set title to "Install Font"
  58.     // and set cancel button to "OK"
  59.     document.title = fontPackageBundle.getString("windowTitleNoDownload");
  60.     dialog.getButton("cancel").label = fontPackageBundle.getString("cancelButtonNoDownload");
  61.   } 
  62.   else 
  63.   {
  64.     document.getElementById("install").hidden = true;
  65.   
  66.     var sizeString = fontPackageBundle.getString("size_" + gLangCode);
  67.     document.getElementById("sizeSpecification").value = sizeString;
  68.   }
  69.  
  70.   var titleString = fontPackageBundle.getString("name_" + gLangCode);
  71.   document.getElementById("languageTitle").value = titleString;
  72. }
  73.  
  74. function download()
  75.   window.open("http://www.mozilla.org/projects/intl/fonts/win/redirect/package_" + gLangCode + ".html");
  76. }
  77.  
  78.